home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’92 / Run & Stumpy / source / templock.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-18  |  305 b   |  24 lines  |  [TEXT/MPS ]

  1. #ifndef templock_h
  2. #define templock_h
  3.  
  4. class templock
  5.   {
  6.     private:
  7.         Handle thehandle;
  8.         SignedByte oldstate;
  9.     
  10.     public:
  11.         templock( Handle h )
  12.           {
  13.             thehandle= h;
  14.             oldstate= HGetState( h );
  15.             HLock(h);
  16.           }
  17.         
  18.         ~templock()
  19.           {
  20.             HSetState( thehandle, oldstate );
  21.           }
  22.   };
  23.  
  24. #endif templock_h